#include "settings.h"

Settings nrf24Tool_settings;

SettingMapping settings_map[] = {
    {"sniff_min_channel",
     &nrf24Tool_settings.sniff_settings[SNIFF_SETTING_MIN_CHANNEL].value.u8,
     SETTING_TYPE_UINT8},
    {"sniff_max_channel",
     &nrf24Tool_settings.sniff_settings[SNIFF_SETTING_MAX_CHANNEL].value.u8,
     SETTING_TYPE_UINT8},
    {"sniff_scan_time",
     &nrf24Tool_settings.sniff_settings[SNIFF_SETTING_SCAN_TIME].value.u16,
     SETTING_TYPE_UINT16},
    {"sniff_data_rate",
     &nrf24Tool_settings.sniff_settings[SNIFF_SETTING_DATA_RATE].value.d_r,
     SETTING_TYPE_DATA_RATE},
    {"sniff_rpd", &nrf24Tool_settings.sniff_settings[SNIFF_SETTING_RPD].value.b, SETTING_TYPE_BOOL},
    {"badmouse_addr_index",
     &nrf24Tool_settings.badmouse_settings[BADMOUSE_SETTING_ADDR_INDEX].value.u8,
     SETTING_TYPE_UINT8},
    {"badmouse_kb_layout",
     &nrf24Tool_settings.badmouse_settings[BADMOUSE_SETTING_KB_LAYOUT].value.u8,
     SETTING_TYPE_UINT8},
    {"badmouse_data_rate",
     &nrf24Tool_settings.badmouse_settings[BADMOUSE_SETTING_DATA_RATE].value.d_r,
     SETTING_TYPE_DATA_RATE},
    {"badmouse_tx_power",
     &nrf24Tool_settings.badmouse_settings[BADMOUSE_SETTING_TX_POWER].value.t_p,
     SETTING_TYPE_TX_POWER},
    {"badmouse_tx_retry",
     &nrf24Tool_settings.badmouse_settings[BADMOUSE_SETTING_TX_RETRY].value.u8,
     SETTING_TYPE_UINT8},
    {"badmouse_key_delay",
     &nrf24Tool_settings.badmouse_settings[BADMOUSE_SETTING_KEY_DELAY].value.u8,
     SETTING_TYPE_UINT8},
    {"rx_channel",
     &nrf24Tool_settings.rx_settings[RX_SETTING_CHANNEL].value.u8,
     SETTING_TYPE_UINT8},
    {"rx_data_rate",
     &nrf24Tool_settings.rx_settings[RX_SETTING_DATA_RATE].value.d_r,
     SETTING_TYPE_DATA_RATE},
    {"rx_addr_width",
     &nrf24Tool_settings.rx_settings[RX_SETTING_ADDR_WIDTH].value.a_w,
     SETTING_TYPE_ADDR_WIDTH},
    {"rx_crc", &nrf24Tool_settings.rx_settings[RX_SETTING_CRC].value.crc, SETTING_TYPE_CRC_LENGHT},
    {"rx_rpd", &nrf24Tool_settings.rx_settings[RX_SETTING_RPD].value.b, SETTING_TYPE_BOOL},
    {"rx_ack_payload",
     &nrf24Tool_settings.rx_settings[RX_SETTING_ACK_PAY].value.i8,
     SETTING_TYPE_PIPE_NUM},
    {"rx_p0_payload",
     &nrf24Tool_settings.rx_settings[RX_SETTING_P0_PAYLOAD].value.u8,
     SETTING_TYPE_PAYLOAD_SIZE},
    {"rx_p0_auto_ack",
     &nrf24Tool_settings.rx_settings[RX_SETTING_P0_AUTO_ACK].value.b,
     SETTING_TYPE_BOOL},
    {"rx_p0_addr",
     &nrf24Tool_settings.rx_settings[RX_SETTING_P0_ADDR].value.addr,
     SETTING_TYPE_ADDR},
    {"rx_p1_payload",
     &nrf24Tool_settings.rx_settings[RX_SETTING_P1_PAYLOAD].value.u8,
     SETTING_TYPE_PAYLOAD_SIZE},
    {"rx_p1_auto_ack",
     &nrf24Tool_settings.rx_settings[RX_SETTING_P1_AUTO_ACK].value.b,
     SETTING_TYPE_BOOL},
    {"rx_p1_addr",
     &nrf24Tool_settings.rx_settings[RX_SETTING_P1_ADDR].value.addr,
     SETTING_TYPE_ADDR},
    {"rx_p2_payload",
     &nrf24Tool_settings.rx_settings[RX_SETTING_P2_PAYLOAD].value.u8,
     SETTING_TYPE_PAYLOAD_SIZE},
    {"rx_p2_auto_ack",
     &nrf24Tool_settings.rx_settings[RX_SETTING_P2_AUTO_ACK].value.b,
     SETTING_TYPE_BOOL},
    {"rx_p2_addr",
     &nrf24Tool_settings.rx_settings[RX_SETTING_P2_ADDR].value.addr,
     SETTING_TYPE_ADDR_1BYTE},
    {"rx_p3_payload",
     &nrf24Tool_settings.rx_settings[RX_SETTING_P3_PAYLOAD].value.u8,
     SETTING_TYPE_PAYLOAD_SIZE},
    {"rx_p3_auto_ack",
     &nrf24Tool_settings.rx_settings[RX_SETTING_P3_AUTO_ACK].value.b,
     SETTING_TYPE_BOOL},
    {"rx_p3_addr",
     &nrf24Tool_settings.rx_settings[RX_SETTING_P3_ADDR].value.addr,
     SETTING_TYPE_ADDR_1BYTE},
    {"rx_p4_payload",
     &nrf24Tool_settings.rx_settings[RX_SETTING_P4_PAYLOAD].value.u8,
     SETTING_TYPE_PAYLOAD_SIZE},
    {"rx_p4_auto_ack",
     &nrf24Tool_settings.rx_settings[RX_SETTING_P4_AUTO_ACK].value.b,
     SETTING_TYPE_BOOL},
    {"rx_p4_addr",
     &nrf24Tool_settings.rx_settings[RX_SETTING_P4_ADDR].value.addr,
     SETTING_TYPE_ADDR_1BYTE},
    {"rx_p5_payload",
     &nrf24Tool_settings.rx_settings[RX_SETTING_P5_PAYLOAD].value.u8,
     SETTING_TYPE_PAYLOAD_SIZE},
    {"rx_p5_auto_ack",
     &nrf24Tool_settings.rx_settings[RX_SETTING_P5_AUTO_ACK].value.b,
     SETTING_TYPE_BOOL},
    {"rx_p5_addr",
     &nrf24Tool_settings.rx_settings[RX_SETTING_P5_ADDR].value.addr,
     SETTING_TYPE_ADDR_1BYTE},
    {"rx_logging", &nrf24Tool_settings.rx_settings[RX_SETTING_LOGGING].value.b, SETTING_TYPE_BOOL},
    {"tx_channel",
     &nrf24Tool_settings.tx_settings[TX_SETTING_CHANNEL].value.u8,
     SETTING_TYPE_UINT8},
    {"tx_data_rate",
     &nrf24Tool_settings.tx_settings[TX_SETTING_DATA_RATE].value.d_r,
     SETTING_TYPE_DATA_RATE},
    {"tx_addr_width",
     &nrf24Tool_settings.tx_settings[TX_SETTING_ADDR_WIDTH].value.a_w,
     SETTING_TYPE_ADDR_WIDTH},
    {"tx_addr", &nrf24Tool_settings.tx_settings[TX_SETTING_TX_ADDR].value.addr, SETTING_TYPE_ADDR},
    {"tx_payload",
     &nrf24Tool_settings.tx_settings[TX_SETTING_PAYLOAD_SIZE].value.u8,
     SETTING_TYPE_PAYLOAD_SIZE},
    {"tx_from_file",
     &nrf24Tool_settings.tx_settings[TX_SETTING_FROM_FILE].value.b,
     SETTING_TYPE_BOOL},
    {"tx_auto_ack",
     &nrf24Tool_settings.tx_settings[TX_SETTING_AUTO_ACK].value.b,
     SETTING_TYPE_BOOL},
    {"tx_repeat",
     &nrf24Tool_settings.tx_settings[TX_SETTING_SEND_COUNT].value.u8,
     SETTING_TYPE_UINT8},
    {"tx_interval",
     &nrf24Tool_settings.tx_settings[TX_SETTING_TX_INTERVAL].value.u16,
     SETTING_TYPE_UINT16},
    {"tx_ack_payload",
     &nrf24Tool_settings.tx_settings[TX_SETTING_ACK_PAY].value.b,
     SETTING_TYPE_BOOL},
    {"tx_crc", &nrf24Tool_settings.tx_settings[TX_SETTING_CRC].value.crc, SETTING_TYPE_CRC_LENGHT},
    {"tx_tx_power",
     &nrf24Tool_settings.tx_settings[TX_SETTING_TX_POWER].value.t_p,
     SETTING_TYPE_TX_POWER},
    {"tx_arc", &nrf24Tool_settings.tx_settings[TX_SETTING_ARC].value.u8, SETTING_TYPE_UINT8},
    {"tx_ard", &nrf24Tool_settings.tx_settings[TX_SETTING_ARD].value.u16, SETTING_TYPE_UINT16},
    {"tx_logging", &nrf24Tool_settings.tx_settings[TX_SETTING_LOGGING].value.b, SETTING_TYPE_BOOL},
};
